//
//  ZCTool.h
//  Mooc
//
//  Created by ZhangCheng on 15/11/16.
//  Copyright © 2015年 ZhangCheng. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ZCTool : NSObject

@property(nonatomic,strong)NSDictionary *userInfo;//记录用户token等信息
@property(nonatomic,copy)NSString *tokenString;
@property(nonatomic,copy)NSString *currentGoodsIdForTBLX;
+(ZCTool*)sharedInstance;
-(BOOL)isLogin;
-(void)logout;
-(void)saveTokenString:(NSString*)token;
+ (NSString*) getUUIDString;
-(void)login:(NSDictionary*)user;
-(BOOL)isValidateUsername:(NSString *)username;
-(BOOL)isValidateEmail:(NSString *)email;
-(BOOL)validateMobile:(NSString *)mobileNum;
- (BOOL)validateLearnNum:(NSString *)learnNum;
- (BOOL)validatePassword:(NSString *)password;
-(NSString*)replaceOrAddQueryItem:(NSURLQueryItem*)queryItem onURL:(NSURL*)sourceURL;
+ (CGFloat)localFileSpaceInMB;
+ (CGFloat)freeDiskSpaceInMB;

- (NSString *)md5HexDigest:(NSString*)input;
- (UIViewController *)getCurrentVC;

@property(nonatomic,strong)UIViewController *currentBGVC;
-(void)showViewController:(UIViewController *)vc inSecond:(CGFloat)second;
-(void)dismissWithAnimation:(CGFloat)second;

- (NSString*)convertToJSONData:(id)infoDict;
-(NSString *)base64ByZC:(NSString *)originString;

- (NSString *)getIPAddress:(BOOL)preferIPv4;
+(NSString *)reviseString:(NSString *)str;
@end
